using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using DealerPlatform.Core.Repository;
using DealerPlatform.Domain;
using Microsoft.AspNetCore.Mvc;

namespace DealerPlatform.Web
{
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class Test01Controller : ControllerBase
    {
        readonly IRepository<Customer> _repository;
        public Test01Controller(IRepository<Customer> repository)
        {
            _repository = repository;
        }

        [HttpGet]
        public async Task<List<Customer>> Get()
        {
            return await _repository.GetListAsync();
        }

        [HttpGet]
        public async Task<List<Customer>> Get2()
        {
            return await _repository.GetListAsync(d=>d.Id==1);
        }
    }
}